<!DOCTYPE html>
<head>
    <title>确认订单页面</title>
    @include('web.layout.head')
    @include('web.layout.header_proscenium')
    <link rel="stylesheet" href="{{mix('/css/web/order/submit_payment.css')}}">
</head>
<body>
    <div class="shopcar-header">
        <div class="w1200 f-cb">
            <a class="logo fl" href="<?php echo asset('');?>"><img src="{{asset('/img/web/logo/forget_logo.png')}}" alt=""></a>
            <span class="fl tit">支付</span>
            @foreach($orders as $order)
                @if($order['order_type']==4)
                    <img class="flow1 fr" src="{{asset('/img/web/order/img1281.jpg')}}" alt="" class="fr"/>
                @elseif($order['order_type']==6)
                    <img class="flow2 fr" src="{{asset('/img/web/order/zizhi3.png')}}" alt="" class="fr" />
                @else
                    <img class="flow fr" src="{{asset('/img/web/order/img128.jpg')}}" alt="" class="fr" />
                @endif
            @endforeach
        </div>
    </div>
    <div class="payment-wrap">
        <div class="w1200">
            <div class="top-hint f-cb">
                <span class="ico fl"></span>
                <div class="fl">
                    <span>订单提交成功，请您尽快完成支付！</span>
                    <div class="tips">（请您在<span>24</span>小时内完成支付，逾期未支付，订单将被系统自动取消。）</div>
                </div>
                <div class="fr f12 right f-cb">
                    应付金额：<span class="f24 oran">￥{{sprintf("%.2f",$total_order_money)}}</span>
                    <div class="clear"></div>
                    <div class="infomore fr">订单详情</div>
                </div>
            </div>
            @foreach($orders as $order)
            <div class="info">
                <p><b>收货地址：</b> {{array_get($order,'address')}} - {{array_get($order,'receiver')}} </p>
                <div class="proinfo f-cb">
                    <span class="tit"><b>商品信息：</b></span>
                    <ul>
                        @if($order_products = array_get($order, 'order_products'))
                            @foreach($order_products as $order_product)
                                <li> {{$order_product['product_name']}}  &nbsp;&nbsp;<b>规格：</b>{{$order_product['model']}}</li>
                            @endforeach
                        @endif
                    </ul>
                </div>
            </div>
            @endforeach
            {{--<a href=" {{asset('/order/submit_balance_pay?')}}" class="balance hover">
                <label class="fl tt">点击使用余额支付</label>
                <span class="fl">可用余额：0  <i></i> 元</span>
                <span class="fr pay">实付金额：<span class="ccc0000">￥ 111111</span></span>
            </a>--}}
            <div class="selec-type">
                <div class="w-f selec-box bord">
                    <div class="titbox f-cb">
                        {{--<span class="fl"><span class="f18">其他支付</span>　支持支付宝、银联支付等支付方式。<span style="color:red">提示：企业网银支付，如果选择银行需要USBKey时，请先插入。</span> </span>--}}
                        <span class="fl"><span class="f18">支付方式</span></span>
                    </div>
                    <div class="subbox" style="display: block;">
                        <ul class="por">
                            <li class="hover" data-id="0">
                                <img src="{{asset('/img/web/order/czbank2.png')}}" alt="" />
                            </li>
                             <!-- <li data-id="5">
                                <img src="{{asset('/img/web/order/czbank1.png')}}" alt="" />
                                                         </li>
                                                         <li data-id="7">
                                <img src="{{asset('/img/web/order/czbank3.jpg')}}" alt="" />
                                                         </li>
                                                         <li data-id="8">
                                <img src="{{asset('/img/web/order/czbank4.jpg')}}" alt="" />
                                                         </li> -->
                            <div class="poa uploading">
                                <div class="wzd-ys fl">
                                    <span>上传承兑汇票</span>
                                </div>
                                <div class="control-group fl chengdui">
                                    <div class="controls">
                                        <div class="btn-group">
                                            <span class="btn btn-success por">
                                                <i class="fa fa-upload"></i>
                                                <span>  </span>
                                                <input class="fileupload" type="file" accept="" />
                                                <span class="fuga poa">浏览</span>
                                            </span>
                                            <input type="hidden" name="photo" class="form-upload" data-more="0" value="" />
                                            <input type="hidden" name="thumb" class="form-upload-thumb" value="" />
                                        </div>
                                    </div>
                                </div>
                                <div id="js-photo-show" class="js-img-list-f">
                                    <!-- 模板 #tpl-img-list -->
                                </div>
                                <input class="fl upbt" type="submit" value="上传" />
                                <img class="tran-sj poa" src="{{asset('/img/web/order/imgs_01.jpg')}}" alt="" />
                                <div class="clear"></div>
                            </div>

                        </ul>
                        <!-- <div class="czbank_explain_box">
                            <div class="czbank_explain">
                                企业对公支付可以选择此种方式付款，同时也支持个人银行的网银支付。如果您在支付过程中发现，受您的银行卡额度限制，不能完成支付，建议您可以联系银行咨询相关网银业务以获得更高支付限额。
                            </div>
                            <img src="{{asset('/img/web/order/dsj.jpg')}}">
                        </div> -->
                    </div>
                </div>
            </div>
            <div class="bot-submit f-cb">
                <input id="type-inp" type="hidden" name='paytype' value=''>
                <input id='order_codes' type="hidden" name='order_codes' value='{{$order_codes}}'>
                <input id='total_order_money' type="hidden" name='total_order_money' value='{{$total_order_money}}'>
                <a href="#">
                    <input id='pay' type="submit" class="fr sub-btn" value="确认并付款">
                </a>
            </div>
        </div>
    </div>
    <div id="payment_afte">
        <div id="payment_after_box">
            <h2>登录网上银行付款</h2>
            <div class="after_close">×</div>
            <div class="modal-body">
                <img class="sigh" src="{{asset('/img/web/inc/icon/u103.png')}}">
                <div class="payment_describe">请您在新打开的网上银行页面进行支付<br>支付完成前请不要关闭该窗口</div>
            </div>
            <div class="payment_after_box_footer">
                <a class="btn-completed">已完成付款</a>
                <!-- <a class="btn-problem">付款遇到问题</a> -->
            </div>
            <!-- <a class="go_back">返回选择其他支付方式 >></a> -->
        </div>
    </div>

    <div class="hide-jump-to-pay"><a target="_blank"><span class="jump-to-pay"></span></a></div>

    @include('web.layout.footer_ware1')
    <script type="text/javascript">
        $(function() {

            $(".dy-yas").click(function() {
                $(".uploading").show();
            });
            /*$(".payment-wrap .subbox li").click(function() {
                var index = $(this).index();
                $(this).addClass('hover').siblings('').removeClass('hover');
                if(index == 0){
                    $('.czbank_explain_box img').css({'left':'72px'});
                    $('.czbank_explain').html('企业对公支付可以选择此种方式付款，同时也支持个人银行的网银支付。如果您在支付过程中发现，受您的银行卡额度限制，不能完成支付，建议您可以联系银行咨询相关网银业务以获得更高支付限额。');
                }else if(index == 1){
                    $('.czbank_explain_box img').css({'left':'244px'});
                    $('.czbank_explain').html('个人银行卡支付可以选择此种方式付款，一次绑定快捷付款。如果您在支付过程中发现，受您的银行卡额度限制，不能完成支付，建议您可以联系银行咨询相关网银业务以获得更高支付限额。');
                }else if(index == 2){
                    $('.czbank_explain_box img').css({'left':'416px'});
                    $('.czbank_explain').html('通过手机支付宝扫码可以选择此种方式付款，同时也支持花呗。如果您在支付过程中发现，受您的银行卡额度限制，不能完成支付，建议您可以联系银行咨询相关网银业务以获得更高支付限额。');
                }else if(index == 3){
                    $('.czbank_explain_box img').css({'left':'588px'});
                    $('.czbank_explain').html('通过手机微信扫码可以选择此种方式付款。如果您在支付过程中发现，受您的银行卡额度限制，不能完成支付，建议您可以联系银行咨询相关网银业务以获得更高支付限额。');
                }
            });*/
            $('.infomore').click(function(event) {
                $('.payment-wrap .info').slideToggle();
            });
            $('.sub-btn').on('click', function(event) {
                event.preventDefault();
                $('#payment_afte').show();
                var pay_id = $(".por").find('li.hover').data('id');
                var order_codes = $("#order_codes").val();
                var total_order_money = $("#total_order_money").val();
                var jump_url = '/member/buyer/submit_pay?order_codes=' + order_codes + '&total_order_money='+ total_order_money +'&pay_id=' + pay_id;
                $('.hide-jump-to-pay a').attr('href', jump_url);
                $('.jump-to-pay').click();
            });
            $(".btn-completed").click(function(){
                location.href = '/member/buyer/orders?order_status=2';
            });
            $(".after_close, .go_back").click(function(){
                var order_codes = $("#order_codes").val();
                /*$.ajax({
                    url: 'check_pay_status',
                    type: 'GET',
                    dataType: 'json',
                    data: {'order_codes': order_codes},
                    success:function(data){
                        if(data.status == 'success'){
                            location.href = '/buyer/order_list';
                        }else{
                            $('#payment_afte').hide();
                        }
                    }
                });*/
                $('#payment_afte').hide();
            });
            $(".btn-problem").click(function(){
                var order_codes = $("#order_codes").val();
                $.ajax({
                    url: 'check_pay_status',
                    type: 'GET',
                    dataType: 'json',
                    data: {'order_codes': order_codes},
                    success:function(data){
                        if(data.status == 'success'){
                            location.href = '/buyer/order_list';
                        }else{
                            location.href = '/helper/index/32';
                        }
                    }
                });
            });
        })
    </script>
</body>

</html>